<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="~{layout/default}">
<head>
    <meta charset="UTF-8">
    <title>帝一流</title>
    <link th:href="@{/static/plugin/bootstrap-table/bootstrap-table.css}" type="text/css" rel="stylesheet">
</head>
<body>
<div layout:fragment="cm-flex" class="cm-flex">
    <div class="cm-breadcrumb-container">
        <ol class="breadcrumb">
            <li><a href="#">宠物管理</a></li>
            <li class="active">宠物分布</li>
        </ol>
    </div>
    <form id="cm-search" action="index.html" method="get">
        <input type="search" name="q" autocomplete="off" placeholder="Search...">
    </form>
</div>
<div layout:fragment="content" class="container-fluid">
    <div class="panel panel-default">
        <div class="panel-body auto-height">
            <div class="search-block" id="search-block">
                <form action="#" class="form-group form-horizontal">
                    <div class="row">
                        <div class="col-sm-3 col-md-4">
                            <input type="text" class="form-control" placeholder="设备ID" id="search"
                                   data-toggle="completer" data-suggest="true">
                        </div>
                        <div class="col-sm-4 col-md-3">
                            <div class="input-group">
                                <input type="text" class="form-control" id="createTime" placeholder="时间">
                                <span class="input-group-btn">
                                        <button class="btn btn-default" type="button" id="btnTime">
                                             <img th:src="@{/static/img/sf/calendar-clock.svg}" height="18" width="18">
                                        </button>
                                </span>
                            </div>
                        </div>
                        <div class="col-sm-2 col-sm-offset-3 col-md-1 col-md-offset-4">
                            <button type="button" class="btn btn-primary btn-block" id="doSearch">查询</button>
                        </div>
                    </div>
                </form>
            </div>

            <div id="map-panel" style="padding-top: 20px">
                <div id="amap" class="map"></div>
            </div>
        </div>
    </div>
</div>
<div layout:fragment="myJs">
    <script src="http://webapi.amap.com/maps?v=1.4.6&key=e6f07e683b599f2d9e4c7f79073d1c7b"></script>
    <script th:inline="javascript">
        $(function () {
            var autoHeight = $("div.auto-height").height();
            var rowHeight = $('#search-block').height();
            var height = autoHeight - rowHeight;
            $('#map-panel').height(height - 20);


            var position = new AMap.LngLat(117.2633468, 34.25815676);//标准写法
            var map = new AMap.Map('amap', {
                resizeEnable: true,
                zoom: 14,
                center: position
            });

            AMap.plugin(["AMap.ToolBar", "AMap.Scale"], function () {
                map.addControl(new AMap.ToolBar());
                map.addControl(new AMap.Scale());
            });

            // 创建一个 Marker 实例：
            var marker = new AMap.Marker({
                position: position,   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
                title: '家'
            });
            // 将创建的点标记添加到已有的地图实例：
            map.add(marker);
        })
    </script>
</div>
</body>
</html>